#!/usr/bin/perl

require './upgrade-lib.pl';

#&ReadParse();
#&ReadParseMime();

my ($version, $sv_mount_dev);

$version = &get_current_version();

$sv_mount_dev = &get_sysvol_mount_dev();

&header($text{'index_title'}, "", "index", 0, 1);


print "<form name=form_index action=action.cgi enctype=multipart/form-data method=post onsubmit='document.forms[0].upload.disabled=true;'>";

print "<p><b>$text{'current_version'}</b>";

print $version;

if(($sv_mount_dev eq "") || ($sv_mount_dev =~ /ram/))
{
	print "<p>$text{'err_msg_sv_devram'}";
}
else
{
	print "<p><b>$text{'lable_location'}";

	print "<p><input name=inputfile type='file' class=text>";
	print "<p><input name=upload type=submit class=button1 value=\"$text{'submit_upgrade'}\" onclick='return onclk_submit();'>";
}

print "</form>";

print <<EOF;
<script>

function onclk_submit()
{

	if(document.forms[0].inputfile.value == "")
	{
		 alert("$text{'msg_infile_empty'}");
                 return false;
	}

        if(!confirm("$text{'msg_confirm'}"))
        {
                return false;
        }
}

</script>
EOF

&footer("/", $text{"index"});
